<%@page import="java.text.SimpleDateFormat"%>
<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<!doctype html>
<html>
<head>
<base href="<%=basePath%>" />
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="renderer" content="webkit">
<meta http-equiv="Cache-Control" content="no-siteapp" />
<link rel="icon" type="image/png" href="i/xianqu.ico">
<link rel="apple-touch-icon-precomposed" href="i/app-icon72x72@2x.png">
<meta name="apple-mobile-web-app-title" content="Amaze UI" />
<link rel="stylesheet" href="css/amazeui.min.css" />
<link rel="stylesheet"
	href="js/jquery-editable-select/jquery-editable-select.min.css" />
<link rel="stylesheet" href="css/admin.css">
<link rel="stylesheet" href="css/app.css">
<link rel="stylesheet" href="layui/css/layui.css">
</head>
<%
	String today = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
%>
<body data-type="generalComponents">
	<div class="tpl-portlet-components am-center">
		<div class="am-u-sm-3">
			<form class="layui-form" id="toBankPlayer" datasource="redeemCode/select">
				<ul class="am-list am-list-static">
					<li><span>ID：</span><input name="userId" class="zid" readonly="readonly"></li>
					<!-- label 里的那个for属性 是指向input 等表单里的元素，方便 输入框获取焦点 -->
					<li><span>昵称：</span><input name="nickName" class="zname" readonly="readonly"></li>
					<li><span>订单编号：</span><input name="orderId" id="orderId" class="zorderid" readonly="readonly"></li>
				</ul>
				<select name="state" id="state" placeholder="请选择" lay-filter="state">
	                <option value="1">发货</option>
	                <option value="2">拒绝发货</option>
                </select>
				<br/>
				<button class="layui-btn layui-btn-normal"  lay-submit id="selectbyCondition" onsubmit="return false;">确认</button>
			</form>

		</div>
	</div>
	<script src="js/jquery.min.js"></script>
	<script src="js/amazeui.min.js"></script>
	<script src="js/app.js"></script>
	<script src="js/layer${applicationScope.skin}/layer.js"></script>
	<script src="js/frame/datagrid.js"></script>
	<script src="js/amazeui.datatables.min.js"></script>
	<script src="js/artDialog.js"></script>
	<script src="js/iframeTools.js"></script>
	<script src="js/laydate/laydate.js"></script>
	<script src="layui/layui.all.js"></script>
	<script>
	$("#toBankPlayer").submit(function(ev){
		ev.preventDefault();
         var datasource = $("#toBankPlayer").attr("datasource");
         $.ajax({
        	 type:"POST",
             url:datasource,
             async: true,
             data:{
            	 OrderId:$("#orderId").val(),
            	 State:$("#state  option:selected").val()
             },
             success:function(resp){
            	 if(resp == "" || resp == null){
            		 layer.msg("发送成功",{icon:1});
            		 setTimeout(function(){
                   		var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
                           parent.layer.close(index); //再执行关闭 
                           parent.layui.table.reload('AllTable',{
 								page:{
 									cuur:1
 								},
 								where:{
 									UserId:$('#playerID').val()
 								}
 							});
                   	},2000)
            	 }else{
            	     layer.msg("发送失败",{icon:2});
                     //使用匿名的function
            	 }
             	
             },
             error:function(){
            	 layer.msg("发送失败",{icon:2});
             }
         });
		 //var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
         //parent.layer.close(index); //再执行关闭 

		}); 
	</script>
</body>

</html>
